/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.farmcode.console.api.business;


import com.farmcode.base.dao.DAOException;
import com.farmcode.base.manager.FacadeException;
import com.farmcode.console.api.model.Property;
import com.farmcode.console.api.dao.PropertyDAO;
import javax.ejb.EJB;



/**
 *
 * @author oiprado
 */
public class BasePropertyManagerBean  implements PropertyManager {
  
	@EJB 
	protected PropertyDAO propertyDAO;
        

	public BasePropertyManagerBean(){

	}
	
	@Override
	public void create(Property entity) throws FacadeException {
	try {
			propertyDAO.create(entity);
		} catch (DAOException ex) {
			throw new FacadeException(ex);
		}
	}

	@Override
	public void store(Property entity) throws FacadeException {
		try {
			propertyDAO.store(entity);
		} catch (DAOException ex) {
			throw new FacadeException(ex);
		}
	}

	@Override
	public void remove(Property entity) throws FacadeException {
		try {
			propertyDAO.remove(entity, entity.getId());
		} catch (DAOException ex) {
			throw new FacadeException(ex);
		}
	}




      
}

